home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / text1 / cms_help_files / halign.helpmark < prev    next >
Text File  |  1991-10-23  |  8KB  |  178 lines

  1. +-----------------------------------------------------------------------------+
  2. |                                   halign                                    |
  3. +-----------------------------------------------------------------------------+
  4.  
  5. \halign{ preamble\cr
  6.          tabular text\cr}
  7.  
  8. Abbreviation:  π|noneπ%
  9.  
  10. Parameters:    π|preamble, tabular text, submarkupπ%
  11.  
  12. Submarkup:     π|\lft, \ctr, \rt, \cr, \noalign, \tabskip,
  13. \omit, \multispan, \phantom, && (column repeat)π%
  14.  
  15.     π|Description:π%
  16. The \halign markup is  a way of making tables without  tabbing.  A preamble,
  17. or sample line,  is included immediately after \halign  to act as a template
  18. for the text in each column.  Each successive column in a row begins with an
  19. ampersand (&).   Column descriptions may contain horizontal spaces, indents,
  20. quads,  and horizontal fills.    Each column  description must have  a pound
  21.  
  22. sign (hash mark, #) which acts  as a reference variable, so that text can be
  23. substituted.
  24.     The halign is  read in its entirety.   Every column is  treated as a box
  25. whose width is equal to the largest entry.
  26.     Besides  horizontal  mode  markup  such  as \indent,   you can  use  the
  27. following submarkup in the \halign.
  28.  
  29. \lft  in the preamble will left justify each entry in a column.
  30.  
  31. \ctr  in the preamble will center each entry in a column.
  32.  
  33. \rt  in the preamble will right justify each entry in a column.
  34.  
  35. \cr  marks the end of the preamble, and the end of each row.
  36.  
  37. \noalign  is used outside of  the preamble.  It allows you to enter vertical
  38. mode text  into a  table.   You must  not end a  \noalign with  a \cr.   For
  39. example, if  you wanted to  skip a blank  line between two  row entries, you
  40. would use \noalign{\vs{\bl}}:
  41.  
  42.  
  43. 1000&32\cr
  44. \noalign{\vs{\bl}}
  45. 2000&43\cr
  46.  
  47. \tabskip    puts an  equal  amount  of  space (glue)  between  columns.    A
  48. specification of
  49.  
  50. \tabskip 20pt plus 15pt minus 10pt
  51.  
  52. indicates that the each column is set 20 points apart.  If after the initial
  53. try it is determined that the  table is still narrower than the width of the
  54. page, up to  an additional 15 points of space is  put between columns to try
  55. and get the  table to spread across  the entire page.   If after the initial
  56. try of  20 points  between each column  it is  determined that the  table is
  57. too wide to  fit on the page,  up to 10 points is  subtracted from the space
  58. between each column to try and get the table to fit on the page.
  59.  
  60. \omit   can be  used to  disable to  preamble specification for  that column
  61. and row.   \omit only works  for one column of  one row.   For example, if a
  62. preamble
  63.  
  64. \halign{\lft{#}&\rt{#}\cr
  65.  
  66. was specified, then to center a header over a column, you could enter
  67.  
  68. \omit\ctr{Header 1}&\omit\ctr{Header 2}\cr
  69. 1000&2000\cr
  70.  
  71. \multispan  is used to permit  spanning of several columns.  For example, if
  72. you had a preamble of
  73.  
  74. \halign{\rt{#}&\rt{#}&\rt{#}\cr
  75.  
  76. and you  wanted to  center a title  over the  second and third  columns, you
  77. would enter:
  78.  
  79. first column&\multispan2\ctr{Spanned title}\cr
  80.  
  81. \phantom  is used in decimal alignment.  For example,
  82.  
  83. 00.1234&12.231\cr
  84. 72.8\phantom{000}&1.2\phantom{00}\cr
  85.  
  86. would print the partial table:
  87. +-----------------------------------------------------------------------------+
  88. |                                                                             |
  89. | 00.1234  12.231                                                             |
  90. | 72.8     1.2                                                                |
  91. |                                                                             |
  92. +-----------------------------------------------------------------------------+
  93. && is used to indicate that  the following column preamble is to be repeated
  94. for each of the remaining of  columns.  For example, if you wanted the first
  95. column centered, the second column left justified, and the next five columns
  96. right justified, you could enter
  97.  
  98. \halign{\ctr{#}&\lft{#}&\rt{#}&\rt{#}&
  99.       \rt{#}&\rt{#}&\rt{#}\cr
  100.  
  101. Using the column repeat indicator (&&) you can simplify this to
  102.  
  103. \halign{\ctr{#}&\lft{#}&&\rt{#}\cr
  104.  
  105. This specification  then says  that columns  3, 4,  etc.   all use  the same
  106. preamble, "\rt{#}".
  107.  
  108.     π|Example:π%
  109. This example illustrates \omit, \qquad and \tabskip.
  110.  
  111. \tabskip .5in plus .4in minus .3in
  112. \halign{\rt{#}&\qquad\lft{#}\cr
  113. \omit\ctr{Case}&\omit\qquad\ctr{Blast}\cr
  114. \noalign{\vs{2pt}\hrule\vs{2pt}}
  115. 5000 MT&500\cr
  116. 10000 MT&845--1050\cr }
  117.  
  118. +-----------------------------------------------------------------------------+
  119. |                                                                             |
  120. |                                                                             |
  121. | ..........5000.MT.......500............                                     |
  122. |          10000 MT       845--1050                                           |
  123. |                                                                             |
  124. +-----------------------------------------------------------------------------+
  125.  
  126.     π|Example:π%
  127.  
  128. This      example      makes      use     of      \multispan,       \indent,
  129. \horizontalspace, \noalign and column repeat (&&).
  130.  
  131. \tabletitle{Surface Land Temperature (degrees C)\lbr
  132. Changes after Exchanges}
  133. \vs{10pt}
  134. \halign{\indent\lft{#}&\hs{2em}\rt{#}
  135.        &&\hs{1em}\rt{#}\cr
  136. Case&\multispan4\ctr{Post Detonations (Days)}\cr
  137. Megatonnage&20&100&200&300\cr
  138. \noalign{\vs{10pt}}
  139. 1000&-22&8&7&13\cr
  140. 3000&9&6&8&10\cr
  141. 5000&-7&-26&-20&-11\cr
  142. 10000&-24&-45&-26&-9\cr}
  143.  
  144. +-----------------------------------------------------------------------------+
  145. |                                                                             |
  146. |                                   Table 1                                   |
  147. |                    Surface Land Temperature (degrees C)                     |
  148. |                           Changes after Exchanges                           |
  149. |                                                                             |
  150. |                                                                             |
  151. |  Case       Post Detonations (Days)                                         |
  152. |  Megatonnage   20  100 200      300                                         |
  153. |                                                                             |
  154. |  1000         -22    8   7       13                                         |
  155. |  3000           9    6   8       10                                         |
  156. |  5000          -7  -26 -20      -11                                         |
  157. |  10000        -24  -45 -26       -9                                         |
  158. |                                                                             |
  159. +-----------------------------------------------------------------------------+
  160.  
  161.     π|Notes:π%
  162. \halign  takes  less computer  time  than  \settabs because  it  is  a basic
  163. TEX command.  The advantages to \halign over \settabs are:
  164.  
  165.    * maximum column  widths are  calculated automatically;  you must measure
  166.      the longest entry with \settabs.
  167.    * templates are more versatile  than \settabs; repeatable information can
  168.      be included in the preamble.
  169.    * greater flexibility.
  170.     Refer to  The TEXbook for  more about \halign,  \cr, \noalign, \tabskip,
  171. \phantom, \omit, \multispan, or && (column repeat).
  172.     You  can use  \autofootnote, \autoendnote,  and  \footnote inside  of an
  173. \halign, so long as they are not also inside an \hbox or \vbox.
  174.     Refer to the description of \leader for an example of using \halign with
  175. dot leadering.
  176.     See \strut for row alignment.
  177.     Do not put a \cr on the same line as \noalign.
  178.